package com.song.boot.springstudy.netty.commhandler;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

// 业务处理器：处理字符串消息
public class BusinessHandler extends ChannelInboundHandlerAdapter {
    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        String message = (String) msg;
        System.out.println("收到消息: " + message);
        
        // 回复消息
        ctx.writeAndFlush("回复消息客户端消息: " + "你好客户端"+"s->c");
    }
}